<?php

namespace App\Models;

use Encore\Admin\Traits\AdminBuilder;
use Encore\Admin\Traits\ModelTree;
use Illuminate\Database\Eloquent\Model;


class CategoryAdmin extends Model
{
    use ModelTree, AdminBuilder;

    public function __construct(array $attributes = [])
    {
        $this->setParentColumn('pid');
        $this->setTitleColumn('name');
    }

    /**
     * 关联到模型的数据表
     *
     * @var string
     */
    protected $table = 'category';

    /**
     * 表明模型是否应该被打上时间戳
     *
     * @var bool
     */
    public $timestamps = true;

    public $primaryKey = 'id';


}
